<?php
$url = $mosConfig_live_site."/administrator/components/com_content/uploads/";

$sql = "SELECT * FROM #__content WHERE state=1 AND sectionid=1 AND selling=1 ORDER BY ordering ASC, id DESC LIMIT 0,9";
$database->setQuery($sql);
$lsSelling = $database->loadObjectList();
if (count($lsSelling)>0){
?>
<div style="background:url(<?php echo $mosConfig_live_site;?>/templates/dogolangchang/images/bgline.jpg) repeat-x 0 10px; height:28px; width:248px; padding-top:13px; clear:both"><span id="titlemenuleft" style="cursor:pointer">Sản phẩm bán chạy</span></div>
	<div id="bosuutap" style="margin-bottom:15px;">
	<?php
	for ($i=0; $i<count($lsSelling); $i++){
	$link = sefRelToAbs("index.php?option=com_content&task=view&catid=".$lsSelling[$i]->catid."&id=".$lsSelling[$i]->id).$lsSelling[$i]->title_alias.".html";
		if ($lsSelling[$i]->img!=''){
		?>
		<a href="<?php echo $link;?>" title="<?php echo $lsSelling[$i]->title;?>"><img src="<?php echo $url.$lsSelling[$i]->img;?>" width="74" height="47" /></a>
		<?php
		}else{
		?>
		<a href="<?php echo $link;?>" title="<?php echo $lsSelling[$i]->title;?>"><img src="<?php echo $url;?>no_pic.gif" width="74" height="47" /></a>
		<?php
		}
	}
	?>	
	</div>
<div style="clear:both"></div>
<?php 
}
?>